<!-- #layout name=empty -->
<script>
    $(function() {
        var pageId = Kooboo.getQueryString("Id");
        Kooboo.Page.getEdit({
            Id: pageId
        }).then(function(res) {

            if (res.success) {
                var url = '';
                switch (res.model.type.toLowerCase()) {
                    case 'layout':
                        url = Kooboo.Route.Get(Kooboo.Route.Page.EditLayout, {
                            id: pageId,
                            layoutId: res.model.layoutId
                        });
                        break;
                    case 'normal':
                        url = Kooboo.Route.Get(Kooboo.Route.Page.EditPage, {
                            id: pageId
                        });
                        break;
                    case 'richtext':
                        url = Kooboo.Route.Get(Kooboo.Route.Page.EditRichText, {
                            id: pageId
                        });
                        break;
                }
                location.href = url;
            }
        })
    })
</script>